package com.ytjj.qmyx.admin.dao;

import com.ytjj.qmyx.admin.model.request.BankerProductRequest;
import com.ytjj.qmyx.admin.model.request.bankerProduct.BankerProductImgRequest;
import com.ytjj.qmyx.admin.model.request.bankerProduct.BankerProductSkuKeyRequest;
import com.ytjj.qmyx.admin.model.request.bankerProduct.BankerProductSpecRequest;
import com.ytjj.qmyx.admin.model.response.BankerProduct.BankerProductDetailResponse;
import com.ytjj.qmyx.admin.model.response.BankerProductResponse;
import com.ytjj.qmyx.admin.model.response.goods.ProductImgResponse;
import com.ytjj.qmyx.mall.model.BankerProduct;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 *
 * @Version: 1.0
 */
@Repository
public interface BankerProductDao {

    List<BankerProductResponse> selectList(BankerProductRequest bankerProductRequest);

    List<BankerProductResponse> selectListV2(BankerProductRequest bankerProductRequest);

    List<Integer> getActivityType(@Param("bankerProductId") Integer bankerProductId);

    Integer updateAuditStatus(@Param("bankerProductId") Integer bankerProductId,
                              @Param("auditStatus") Integer auditStatus, @Param("appraisalType") Integer appraisalType);

    Integer synvBankerColumn(@Param("bankerProductId") Integer bankerProductId,
                              @Param("bankerColumnId") Integer bankerColumnId);

    Integer synvBankerProductColumn(@Param("bankerProductId") Integer bankerProductId,
                                    @Param("bankerColumnId") Integer bankerColumnId,
                                    @Param("stock") Integer stock,
                                    @Param("costPrice") BigDecimal costPrice,
                                    @Param("brandId") Integer brandId, @Param("brand") String brand,
                                    @Param("topCategoryId") Integer topCategoryId,
                                    @Param("categoryId") Integer categoryId,
                                    @Param("bottomCategoryId") Integer bottomCategoryId,
                                    @Param("addressId") Integer addressId,
                                    @Param("isExit") Integer isExit,
                                    @Param("mailType") String mailType,
                                    @Param("mailNote") String mailNote
                                    );

    Integer synvBankerProductColumnV2(@Param("bankerProductId") Integer bankerProductId,
                             @Param("bankerColumnId") Integer bankerColumnId,
                             @Param("stock") Integer stock,
                                @Param("costPrice") BigDecimal costPrice,
                                    @Param("brandId") Integer brandId, @Param("brand") String brand,
                                   @Param("addressId") Integer addressId
                                    );

    Integer updateStatus(@Param("bankerProductId") Integer bankerProductId, @Param("status") Integer status);

    Integer verifyFail(@Param("id") Integer id, @Param("verifyRemarks") String verifyRemarks);

    BankerProductResponse getBankerProduct(Integer id);

    List<BankerProductDetailResponse> findInfoById(Integer productId);

    List<BankerProductDetailResponse> findInfoByIdV2(Integer productId);

    List<BankerProductSkuKeyRequest> findSku(Integer productId);

    List<BankerProductImgRequest> findImg(@Param("productId") Integer productId, @Param("type") String type);

    List<BankerProductSpecRequest> findSpec(Integer productId);

    Integer isHoliday(Integer bankerId);

    List<Integer> selectIdsByBrandId(@Param("brandId") Integer brandId);

    int updateBrandIdById(@Param("id") Integer id, @Param("brandId") Integer brandId);

    Integer updateStatusAndAuditStatus(@Param("bankerProductId") Integer bankerProductId, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus);

    Integer updateBankerProduct(BankerProduct bankerProduct);

    Integer deleteOldImg(@Param("productId")Integer productId,@Param("type") String type);

    void saveImg(@Param("img") List<ProductImgResponse> img);

}
